﻿using System;
using FizzBuzzConsoleClient;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace UnitTests
{
    [TestClass]
    public class FizzBuzzNumberTests
    {
        [TestMethod]
        [ExpectedException(typeof(NotSupportedException))]
        public void Constructor_ValueIsNegative_ThrowsNotSupportedException()
        {
            // Arrange

            // Act
            new FizzBuzzNumber(-1);

            // Assert - covered by the expected exception
        }

        [TestMethod]
        public void ToString_ValueIsZero_ReturnsCorrectString()
        {
            // Arrange
            var fizzBuzzNumber = new FizzBuzzNumber(0);

            // Act
            var result = fizzBuzzNumber.ToString();

            // Assert
            Assert.AreEqual("0", result);
        }

        [TestMethod]
        public void ToString_ValueIsArbitaryNumber_ReturnsCorrectString()
        {
            // Arrange
            var fizzBuzzNumber = new FizzBuzzNumber(11);

            // Act
            var result = fizzBuzzNumber.ToString();

            // Assert
            Assert.AreEqual("11", result);
        }

        [TestMethod]
        public void ToString_ValueIsMultipleOfThree_ReturnsFizz()
        {
            // Arrange
            var fizzBuzzNumber = new FizzBuzzNumber(99);

            // Act
            var result = fizzBuzzNumber.ToString();

            // Assert
            Assert.AreEqual("Fizz", result);
        }

        [TestMethod]
        public void ToString_ValueIsMultipleOfFive_ReturnsBuzz()
        {
            // Arrange
            var fizzBuzzNumber = new FizzBuzzNumber(50);

            // Act
            var result = fizzBuzzNumber.ToString();

            // Assert
            Assert.AreEqual("Buzz", result);
        }

        [TestMethod]
        public void ToString_ValueIsMultipleOfThreeAndFive_ReturnsFizzBuzz()
        {
            // Arrange
            var fizzBuzzNumber = new FizzBuzzNumber(75);

            // Act
            var result = fizzBuzzNumber.ToString();

            // Assert
            Assert.AreEqual("FizzBuzz", result);
        }
    }
}
